#include <stdio.h>
#include <stdlib.h>

#define MAX_SIZE 200010 

long long heap[MAX_SIZE]; 
int heap_size = 0; 

void swap(int i, int j)
{
    long long temp = heap[i];
    heap[i] = heap[j];
    heap[j] = temp;
}

void swim(int i) 
{
    while (i > 0) {
        int parent = (i - 1) / 2;
        if (heap[i] < heap[parent]) 
        {
            swap(i, parent);
            i = parent;
        }
        else 
        {
            break;
        }
    }
}

void sink(int i) 
{
    while (2 * i + 1 < heap_size) 
    {
        int left = 2 * i + 1;
        int right = left + 1;
        int min_child = left;
        if (right < heap_size && heap[right] < heap[left]) 
        {
            min_child = right;
        }
        if (heap[min_child] < heap[i])
        {
            swap(i, min_child);
            i = min_child;
        }
        else 
        {
            break;
        }
    }
}

void push(long long x)
{
    heap[heap_size] = x;
    swim(heap_size);
    heap_size++;
}

long long pop() 
{
    long long min_val = heap[0];
    heap[0] = heap[heap_size - 1];
    heap_size--;
    sink(0);
    return min_val;
}

int main()
{
    int n, m;
    scanf_s("%d %d", &n, &m); 

    long long current_max = 0;
    for (int i = 0; i < n; i++) 
    {
        long long score;
        scanf_s("%lld", &score);
        push(score);
        if (score > current_max)
        {
            current_max = score;
        }
    }

    for (int i = 0; i < m; i++) 
    {
        long long b;
        scanf_s("%lld", &b); 

        long long min_score = pop();
        long long new_score = min_score + b;
        push(new_score);

        if (new_score > current_max) 
        {
            current_max = new_score;
        }

        printf("%lld\n", current_max);
    }

    return 0;
}